package bullets;

import java.awt.Graphics;
import java.awt.image.BufferedImage;


public class BulletEnemy extends Bullet{
	/**
	 * 
	 */
	private static final long serialVersionUID = 3426125891823579798L;
	public static BufferedImage image;
	static {
		image = readImage("src/images/buttleEnemy.png");
	}
	private int speed=15;//敌机子弹的移动速度
	public BulletEnemy() {
		super();
	}
	public void step2(int x,int y) {//大招出现时的移动方式
		if(x<this.x) {
			this.x-=speed;
		}else {
			this.x+=speed;
		}
		if(y<this.y) {
			this.y-=speed;
		}else {
			this.y+=speed;
		}
	}
	/*
	 * 
	 */
	public BulletEnemy(int x, int y) {
		super(25, 27, x, y);//宽和高之后再确定，xy由敌机的位置决定
	}
	/*
	 * 敌机子弹的移动方式
	 */
	public void step() {		
		this.y += speed;
	}
	/*
	 * 敌机子弹的另一种移动方式（被英雄机大招吸引）
	 */
	public void moveToSkill() {
		
	}
	/*
	 * 敌机获取图片
	 */
	public BufferedImage getImage() {
		if(isLife()) {
			return image;
		}
		return null;
	}
	
	public void paintImage(Graphics g) {
		g.drawImage(getImage(), x, y,null);	
	}
	
}
